package com.luodea.session.controller;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;

/**
 * @author luodea
 * @date 2020/2/28 10:52
 * @description
 */
@RestController
public class TestController {



    @GetMapping
    public String test(HttpServletRequest request){
        HttpSession session = request.getSession();
        session.setAttribute("name","luodea");
        session.setAttribute("token",session.getId());
        return  session.getId();
    }



}
